import { alova } from '../request';

export type GoodModel = Pick<
  Api.SystemManage.Good,
  'goodImgUrl' | 'goodStockQuantity' | 'goodDescription' | 'goodName' | 'goodPrice' | 'goodStatus' | 'goodCategory'
>;

export function addGood(data: GoodModel) {
  return alova.Post<null>('/goods/createGood', data);
}
export function updateGood(data: GoodModel) {
  return alova.Post<null>('/goods/updateGood', data);
}
export function deleteGood(id: number) {
  return alova.Post<null>('/goods/deleteGood', { id });
}
